<?php

class myUser extends sfBasicSecurityUser
{
   public function signIn($user)
    {
      $this->setAuthenticated(true);
      $this->setAttribute('id', $user->getId());
      $this->setAttribute('username', $user->getUsername());
      $this->setAttribute('fullname', $user->getFullname());
    }
  
    public function signOut()
    {
      $this->getAttributeHolder()->removeNamespace();
      
      $this->setAuthenticated(false);
      $this->clearCredentials();
    }
    
    public function getId()
    {
      return $this->getAttribute('id', 0);
    }
    
    public function getUsername()
    {
      return $this->getAttribute('username', '');  
    }
    
    public function getFullname()
    {
      return $this->getAttribute('fullname', '');
    }
    
    public function getInstance()
    {
      return Doctrine::getTable('User')->find($this->getId());
    }
}
